<template>
   <div >
   <div>
    <MyHeader 
    title="购物车案例练习"
    backgroundColor="black"
    color="#fff"
    
    ></MyHeader>
  </div>

<div class="main" >
<MyGoods 
v-for="obj in list" :key="obj.id" :goodsObj="obj"

>
</MyGoods>
</div>

<div>
  <MyFooter :arr="list" />
</div>

   </div>
</template>

<script>
import MyHeader from "./components/MyHeader"
import MyGoods from "./components/MyGoods"
import MyFooter from "./components/MyFooter"
// import MyCount from "./components/MyCount"
export default {
  data() {
       return {
         list:[]
       }
   },
//方法
methods: {},
//过滤器
filters: {},
// 计算属性
computed: {},
// 侦听器
watch: {},
// 组件名
components:{
MyHeader,
MyFooter,
MyGoods
},
created(){
  this.$axios({
    url:"https://www.escook.cn/api/cart"
  }).then(res => {
    this.list =   res.data.list;
  })
}
}
</script>

<style scoped>
  .main{
    padding: 45px 0 50px 0;
  }
</style>
